package com.designPatterns.singleton;

/**
 * 枚举型单例
 * Created by houjinxin on 16/3/5.
 */
public enum SingletonEnum {
    INSTANCE, SingletonInstantLoadVariant;
    public void doSomething(){
        System.out.println("我是枚举单例的类");
    }

    @Override
    public String toString() {
        //相同对象的哈希值相同
        return "哈希值"+this.hashCode();
    }
}
